package com.paw.portal.response.dto;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import cn.hutool.core.date.DatePattern;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.paw.portal.enums.SysUserEnums;
import com.paw.portal.enums.SysUserEnums.SexEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 用户信息表
 * </p>
 *
 * @author Rubble
 * @since 2021-08-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "SysUserResponseDto对象", description = "用户信息表响应对象")
public class SysUserResponseDto implements Serializable {

  private static final long serialVersionUID = 1L;

  @ApiModelProperty(value = "用户ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;


  @ApiModelProperty(value = "登录账号")
  private String loginName;


  @ApiModelProperty(value = "密码")
  private String password;


  @ApiModelProperty(value = "盐加密")
  private String salt;


  @ApiModelProperty(value = "密码强度")
  private String pwdStrong;


  @ApiModelProperty(value = "用户昵称")
  private String name;


  @ApiModelProperty(value = "手机号码")
  private String phone;


  @ApiModelProperty(value = "用户邮箱")
  private String email;


  @ApiModelProperty(value = "用户性别（0：男；1：女；2：未知）")
  private Integer sex;

  @ApiModelProperty(value = "用户性别")
  private String sexDesc;

  @ApiModelProperty(value = "头像路径")
  private String avatar;


  @ApiModelProperty(value = "职称")
  private String title;


  @ApiModelProperty(value = "部门ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long groupId;


  @ApiModelProperty(value = "部门")
  private String groupName;


  @ApiModelProperty(value = "帐号状态（1：正常；0:停用）")
  private Integer status;

  @ApiModelProperty(value = "帐号状态")
  private String statusDesc;

  @ApiModelProperty(value = "国家")
  private String country;


  @ApiModelProperty(value = "省编码")
  private String provinceCode;


  @ApiModelProperty(value = "市编码")
  private String cityCode;


  @ApiModelProperty(value = "地址")
  private String address;


  @ApiModelProperty(value = "签名")
  private String signature;


  @ApiModelProperty(value = "标签")
  private String tags;


  @ApiModelProperty(value = "微信openId")
  private String wxOpenId;


  @ApiModelProperty(value = "钉钉")
  private String dingtalk;


  @ApiModelProperty(value = "密码最后更新时间")
  @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
  private Date pwdUpdateDate;


  @ApiModelProperty(value = "最后登录IP")
  private String loginIp;


  @ApiModelProperty(value = "最后登录时间")
  @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
  private Date loginTime;


  @ApiModelProperty(value = "备注")
  private String remark;


  @ApiModelProperty(value = "删除标志  1是")
  private Integer delFlag;


  @ApiModelProperty(value = "创建者")
  private String createBy;


  @ApiModelProperty(value = "创建时间")
  @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
  private Date createTime;


  @ApiModelProperty(value = "更新者")
  private String updateBy;


  @ApiModelProperty(value = "更新时间")
  @JsonFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
  private Date updateTime;


  @ApiModelProperty(value = "角色Ids")
  private List<Long> roleIds;

  @ApiModelProperty(value = "角色")
  private String roleNames;


  public String getSexDesc () {
    return SexEnum.getDescByCode(sex);
  }

  public String getStatusDesc () {
    return SysUserEnums.StatusEnum.getDescByCode(status);
  }
}
